home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / prof / sun4c.md / mcount.s < prev    next >
Text File  |  1990-11-07  |  1KB  |  37 lines

  1. /*
  2.  * mcount.s --
  3.  *
  4.  *    Entry point for profiling routine to record each
  5.  *      procedure call, so that the call graph can be
  6.  *      constructed.
  7.  *
  8.  * Copyright 1990 Regents of the University of California
  9.  * Permission to use, copy, modify, and distribute this
  10.  * software and its documentation for any purpose and without
  11.  * fee is hereby granted, provided that the above copyright
  12.  * notice appear in all copies.  The University of California
  13.  * makes no representations about the suitability of this
  14.  * software for any purpose.  It is provided "as is" without
  15.  * express or implied warranty.
  16.  */
  17.  
  18. .seg    "data"
  19. .asciz    "$Header$"
  20. .align    8
  21. .seg    "text"
  22.  
  23. /*
  24.  *  Jump to C routine.
  25.  */
  26.     .global mcount
  27. mcount:
  28.     mov     %r31, %o0           /* get the caller's pc */
  29.     mov     %r15, %o1           /* get the callee's pc */
  30.     save    %sp, -112, %sp      /* save stack frame */
  31.     mov     %i0, %o0            /* move caller's pc up into new stack frame */
  32.     call    ___mcount           /* call C routine to do all the real work */
  33.     mov     %i1, %o1            /* (delay slot) move callee's pc up */
  34.     ret
  35.     restore
  36.  
  37.